package com.example.consumer.consumer;

import com.example.consumer.enums.QueueType;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @description
 * @author shiguorang
 * @date 2023/6/28 19:24:23
 * @version 1.0
 */
@Component
public class TestConsumer {

    @RabbitListener(queues = "sgr-queue")  //指定队列
    @RabbitHandler
    public void process(String msg) {
        System.out.println(QueueType.MY_QUEUE.getValue()+"Receiver  : 消费成功：" + msg);
    }

    @RabbitListener(queues = "exchange_topics_inform")
    @RabbitHandler
    public void other(String msg) {
        System.out.println("exchange_topics_inform  : 消费成功：" + msg);
    }
}
